﻿using System;
using System.Data;
using System.Data.Common;
using Liger.Common;
using Liger.Data;

namespace EasyFMS.Model
{

	/// <summary>
	/// 实体类tMetaColumn
	/// </summary>
	[Serializable]
	public class tMetaColumn : Entity 
	{ 
		 public tMetaColumn() 
            : base("tMetaColumn") 
        { 

        }


		#region Model
		private int _UID;
		private string _TableCode;
		private string _Code;
		private string _Name;
		private string _Type;
		private int? _Length;
		private int? _XPrec;
		private int? _XScale;
		private string _Note;
		private int? _UserCreateID;
		private string _CreateDate;
		private int? _UserModifyID;
		private string _ModifyDate;
	 
		/// <summary>
		/// 
		/// </summary>
		public int UID
		{
			get{ return _UID; }
			set
			{
				this.OnPropertyValueChange(_.UID,_UID,value);
				this._UID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string TableCode
		{
			get{ return _TableCode; }
			set
			{
				this.OnPropertyValueChange(_.TableCode,_TableCode,value);
				this._TableCode = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string Code
		{
			get{ return _Code; }
			set
			{
				this.OnPropertyValueChange(_.Code,_Code,value);
				this._Code = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string Name
		{
			get{ return _Name; }
			set
			{
				this.OnPropertyValueChange(_.Name,_Name,value);
				this._Name = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string Type
		{
			get{ return _Type; }
			set
			{
				this.OnPropertyValueChange(_.Type,_Type,value);
				this._Type = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? Length
		{
			get{ return _Length; }
			set
			{
				this.OnPropertyValueChange(_.Length,_Length,value);
				this._Length = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? XPrec
		{
			get{ return _XPrec; }
			set
			{
				this.OnPropertyValueChange(_.XPrec,_XPrec,value);
				this._XPrec = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? XScale
		{
			get{ return _XScale; }
			set
			{
				this.OnPropertyValueChange(_.XScale,_XScale,value);
				this._XScale = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string Note
		{
			get{ return _Note; }
			set
			{
				this.OnPropertyValueChange(_.Note,_Note,value);
				this._Note = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? UserCreateID
		{
			get{ return _UserCreateID; }
			set
			{
				this.OnPropertyValueChange(_.UserCreateID,_UserCreateID,value);
				this._UserCreateID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string CreateDate
		{
			get{ return _CreateDate; }
			set
			{
				this.OnPropertyValueChange(_.CreateDate,_CreateDate,value);
				this._CreateDate = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public int? UserModifyID
		{
			get{ return _UserModifyID; }
			set
			{
				this.OnPropertyValueChange(_.UserModifyID,_UserModifyID,value);
				this._UserModifyID = value;
			}
		}
		/// <summary>
		/// 
		/// </summary>
		public string ModifyDate
		{
			get{ return _ModifyDate; }
			set
			{
				this.OnPropertyValueChange(_.ModifyDate,_ModifyDate,value);
				this._ModifyDate = value;
			}
		}
		#endregion

		#region Method
		/// <summary>
		/// 获取实体中的标识列
		/// </summary>
		public override Field GetIdentityField()
		{
			return _.UID;
		}
		/// <summary>
		/// 获取实体中的主键列
		/// </summary>
		public override Field[] GetPrimaryKeyFields()
		{
			return new Field[] {
				_.UID			};
		}
		/// <summary>
		/// 获取列信息
		/// </summary>
		public override Field[] GetFields()
		{
			return new Field[] {
				_.UID,
				_.TableCode,
				_.Code,
				_.Name,
				_.Type,
				_.Length,
				_.XPrec,
				_.XScale,
				_.Note,
				_.UserCreateID,
				_.CreateDate,
				_.UserModifyID,
				_.ModifyDate
			};
		}
		/// <summary>
		/// 获取值信息
		/// </summary>
		public override object[] GetValues()
		{
			return new object[] {
				_UID,
				_TableCode,
				_Code,
				_Name,
				_Type,
				_Length,
				_XPrec,
				_XScale,
				_Note,
				_UserCreateID,
				_CreateDate,
				_UserModifyID,
				_ModifyDate
			};
		} 
		/// <summary>
		/// 设置字段值
		/// </summary>
		public override void SetValue(string fieldName, object value)
        {
            switch (fieldName)
            { 
				case "UID":
                    this._UID = DataHelper.ConvertValue<int>(value);
                    break; 
				case "TableCode":
                    this._TableCode = DataHelper.ConvertValue<string>(value);
                    break; 
				case "Code":
                    this._Code = DataHelper.ConvertValue<string>(value);
                    break; 
				case "Name":
                    this._Name = DataHelper.ConvertValue<string>(value);
                    break; 
				case "Type":
                    this._Type = DataHelper.ConvertValue<string>(value);
                    break; 
				case "Length":
                    this._Length = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "XPrec":
                    this._XPrec = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "XScale":
                    this._XScale = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "Note":
                    this._Note = DataHelper.ConvertValue<string>(value);
                    break; 
				case "UserCreateID":
                    this._UserCreateID = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "CreateDate":
                    this._CreateDate = DataHelper.ConvertValue<string>(value);
                    break; 
				case "UserModifyID":
                    this._UserModifyID = DataHelper.ConvertValue<int?>(value);
                    break; 
				case "ModifyDate":
                    this._ModifyDate = DataHelper.ConvertValue<string>(value);
                    break; 
            }
        }
		/// <summary>
		/// 获取字段值
		/// </summary>
        public override object GetValue(string fieldName)
        {
            switch (fieldName)
            { 
				case "UID":
                    return this._UID; 
				case "TableCode":
                    return this._TableCode; 
				case "Code":
                    return this._Code; 
				case "Name":
                    return this._Name; 
				case "Type":
                    return this._Type; 
				case "Length":
                    return this._Length; 
				case "XPrec":
                    return this._XPrec; 
				case "XScale":
                    return this._XScale; 
				case "Note":
                    return this._Note; 
				case "UserCreateID":
                    return this._UserCreateID; 
				case "CreateDate":
                    return this._CreateDate; 
				case "UserModifyID":
                    return this._UserModifyID; 
				case "ModifyDate":
                    return this._ModifyDate; 
				default :
                    return null;
            } 
        }



		#endregion

		#region _Field
		/// <summary>
		/// 字段信息
		/// </summary>
		public class _
		{
			/// <summary>
			/// * 
			/// </summary>
			public readonly static Field All = new Field("*","tMetaColumn");
 
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UID = new Field("UID","tMetaColumn","UID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field TableCode = new Field("TableCode","tMetaColumn","TableCode");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field Code = new Field("Code","tMetaColumn","Code");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field Name = new Field("Name","tMetaColumn","Name");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field Type = new Field("Type","tMetaColumn","Type");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field Length = new Field("Length","tMetaColumn","Length");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field XPrec = new Field("XPrec","tMetaColumn","XPrec");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field XScale = new Field("XScale","tMetaColumn","XScale");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field Note = new Field("Note","tMetaColumn","Note");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UserCreateID = new Field("UserCreateID","tMetaColumn","UserCreateID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field CreateDate = new Field("CreateDate","tMetaColumn","CreateDate");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field UserModifyID = new Field("UserModifyID","tMetaColumn","UserModifyID");
			/// <summary>
			/// 
			/// </summary>
			public readonly static Field ModifyDate = new Field("ModifyDate","tMetaColumn","ModifyDate");
		}
		#endregion

 
	}
}

